package core.cards.election.gui;

import org.eclipse.jface.wizard.Wizard;

import core.cards.election.model.VotingCardOption;

public class WzdAddEditVotingCardOption extends Wizard {

	private boolean addVotingCardOption;
	private VotingCardOption votingCardOption;

	private WzdPgAddEditVotingCardOption wzdPgAddEditVotingCardOption;

	public WzdAddEditVotingCardOption(boolean addVotingCardOption, VotingCardOption votingCardOption) {
		if (addVotingCardOption) {
			setWindowTitle("Add Voting Card");
		} else {
			setWindowTitle("Edit Voting Card");
		}

		this.addVotingCardOption = addVotingCardOption;
		this.votingCardOption = votingCardOption;
	}

	@Override
	public void addPages() {
		wzdPgAddEditVotingCardOption = new WzdPgAddEditVotingCardOption(addVotingCardOption, votingCardOption);
		addPage(wzdPgAddEditVotingCardOption);
	}

	@Override
	public boolean performFinish() {
		wzdPgAddEditVotingCardOption.update();
		return true;
	}
}
